[BOLT] Compress YAML pseudo probe information#166680
Draft
aaupov wants to merge 2 commits intousers/aaupov/spr/main.bolt-compress-yaml-pseudo-probe-informationfrom
Draft
Conversation
Created using spr 1.3.4
You can test this locally with the following command:git-clang-format --diff origin/main HEAD --extensions cpp,h -- bolt/include/bolt/Profile/ProfileYAMLMapping.h bolt/include/bolt/Profile/YAMLProfileWriter.h bolt/include/bolt/Utils/CommandLineOpts.h bolt/lib/Profile/DataAggregator.cpp bolt/lib/Profile/YAMLProfileReader.cpp bolt/lib/Profile/YAMLProfileWriter.cpp bolt/lib/Rewrite/PseudoProbeRewriter.cpp --diff_from_common_commit
View the diff from clang-format here.diff --git a/bolt/lib/Profile/YAMLProfileWriter.cpp b/bolt/lib/Profile/YAMLProfileWriter.cpp
index aad433a8b..817590cb9 100644
--- a/bolt/lib/Profile/YAMLProfileWriter.cpp
+++ b/bolt/lib/Profile/YAMLProfileWriter.cpp
@@ -485,7 +485,7 @@ std::error_code YAMLProfileWriter::writeProfile(const RewriteInstance &RI) {
// Add probe inline tree nodes.
InlineTreeDesc InlineTree;
if (const MCPseudoProbeDecoder *Decoder =
- opts::ProfileWritePseudoProbes ? BC.getPseudoProbeDecoder() : nullptr)
+ opts::ProfileWritePseudoProbes ? BC.getPseudoProbeDecoder() : nullptr)
std::tie(BP.PseudoProbeDesc, InlineTree) = convertPseudoProbeDesc(*Decoder);
// Add all function objects.
|
aaupov
added a commit
that referenced
this pull request
Nov 6, 2025
Pseudo probe matching (#100446) needs callee information for call probes. Embed call probe information (probe id, inline tree node, indirect flag) into CallSiteInfo. As a consequence: - Remove call probes from PseudoProbeInfo to avoid duplication, making it only contain block probes. - Probe grouping across inline tree nodes becomes more potent + allows to unambiguously elide block id 1 (common case). Block mask (blx) encoding becomes a low-ROI optimization and will be replaced by a more compact encoding leveraging simplified PseudoProbeInfo in #166680. The size increase is ~3% for an XL profile (461->475MB). Compact block probe encoding shrinks it by ~6%. Test Plan: updated pseudoprobe-decoding-{inline,noinline}.test
aaupov
added a commit
that referenced
this pull request
Nov 11, 2025
Pseudo probe matching (#100446) needs callee information for call probes. Embed call probe information (probe id, inline tree node, indirect flag) into CallSiteInfo. As a consequence: - Remove call probes from PseudoProbeInfo to avoid duplication, making it only contain block probes. - Probe grouping across inline tree nodes becomes more potent + allows to unambiguously elide block id 1 (common case). Block mask (blx) encoding becomes a low-ROI optimization and will be replaced by a more compact encoding leveraging simplified PseudoProbeInfo in #166680. The size increase is ~3% for an XL profile (461->475MB). Compact block probe encoding shrinks it by ~6%. Test Plan: updated pseudoprobe-decoding-{inline,noinline}.test Reviewers: paschalis-mpeis, ayermolo, yota9, yozhu, rafaelauler, maksfb Reviewed By: rafaelauler Pull Request: #165490
🐧 Linux x64 Test ResultsThe build failed before running any tests. Click on a failure below to see the details. tools/bolt/lib/Profile/CMakeFiles/LLVMBOLTProfile.dir/YAMLProfileReader.cpp.oIf these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce an optional value
compactforprofile-write-pseudo-probesflag,enabling compressed encoding of pseudo probe information in YAML profile:
inline tree nodes in format
[probes]_[nodes]:[from,...,to]are coalesced intofrom^run_length,using base36-encoding.
This significantly reduces the size of YAML profile and makes parsing faster
(as it replaces nested FlowVectors with strings).
Test Plan:
TBD: compress pseudo_probe_desc. Use DFS for probes, and BFS for inline tree.
Measure emission time.